<?php
/**
 * This page maps ToolTips from the url to information stored in the database for display.
 * Found at /info/tooltips/([a-zA-Z0-9_]+)
 * 
 */

/**
 * 
 */

require_once('../SiteIncludes.GLOBAL.php');
$_LIBDEBUG->silence();

$title = '&nbsp;';
$description = '<i>Whoops!</i> We couldn\'t find that info article.';

if(isset($gVAR['alias']) === true) {
    $safe_name = $sql_conx->real_escape_string($gVAR['alias']);
    $query = $sql_conx->query("SELECT `title`,`description` FROM `info_tooltips` WHERE `name`='{$safe_name}' LIMIT 1;");
    if($query->num_rows > 0) {
	$row = $query->fetch_row();
	$title = $row[0];
	$description = nl2br($row[1]);
    }
}

echo <<<EOBODY
    
    <!DOCTYPE html>
	<html>
	    <head><title></title></head>
	    <body>
		<table style="width: 100%; height: 100%;">
		    <tr>
			<td style="width: 40%; background-color: #c0c0c0; font-weight: bold; text-align: center;">
			    {$title}
			</td>
			<td style="width: 60%;">
			    {$description}
			</td>
		    </tr>
		</table>
	    </body>
	</html>
    
    
EOBODY;
?>